<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<title>幻灯片管理</title>
	<link rel="stylesheet" href="../css/common2.css">
	<link rel="stylesheet" href="../css/skyblue/elements.css">
	<style>
		.table {
			width: 98%;
		}

		.add {
			display: inline-block;
			margin-top: 20px;
		}
	</style>
</head>

<body>
	<div id="vue-root" :class="theme">
		<div class="add button-primary" v-if="able.add">
			<a href="basis_slide_item.html" style="color: white">添加幻灯片</a>
		</div>
		<div class="refresh button-primary" onclick="location.reload()">刷新</div>
		<div class="table">
			<table class="table_top">
				<thead>
					<tr>
						<th class="one">
							<input type="checkbox" class="check-box" v-model="all">
						</th>
						<th class="one">序号</th>
						<!-- <th class="one">标题</th> -->
						<th class="two">预览</th>
						<!-- <th class="two">链接地址</th> -->
						<th class="two">是否显示</th>
						<th class="one">编辑/删除</th>
					</tr>
				</thead>
				<tbody id="list">
					<tr v-for="(slide,index) in list" :key="slide.id">
						<td>
							<input type="checkbox" class="check-box" v-model="slide.checked">
						</td>
						<td>
							<span v-text="index+1"></span>
						</td>
						<!-- <td class="one" v-text="slide.title"></td> -->
						<td class="two photo">
							<img :src="'/static/'+slide.schoolId+'/slide/'+slide.pic">
						</td>
						<!-- <td class="two" v-text="slide.illustrate"></td> -->
						<td v-text="slide.isShow?'是':'否'"></td>
						<td class="three">
							<div class="option">
								<div v-if="able.edit" class="edit-icon option-icon"
									style="position: absolute; left: 20%; top: 30%;">
									<a :href="'basis_slide_item.html?id='+slide.id">
										<img class="img" src="../image/edit.png" height="20" width="20"
											onmouseover="this.src='../image/edit_light.png'"
											onmouseout="this.src='../image/edit.png'" />
									</a>
								</div>
								<div v-if="able.del" class="delete-icon option-icon" @click="del([slide.id])"
									style="right: 20%; top:30%;position: absolute;">
									<img class="img" src="../image/delete.png" height="20" width="20"
										onmouseover="this.src='../image/delete_light.png'"
										onmouseout="this.src='../image/delete.png'" />
								</div>
							</div>
						</td>
					</tr>
				</tbody>
			</table>
		</div>
		<br>
		<div class="delete button-danger" @click="batchDelete" v-if="able.del">批量删除</div>
		<ul class="pagination" v-if="pages>1">
			<li>
				<a v-if="pageNum!=1" @click="pageNum=1">«</a>
				<a class="pages-jump" v-if="pageNum!=1" @click="pageNum--">‹</a>
				<a v-text="pageNum"></a>
				<a class="pages-jump" v-if="pageNum!=pages" @click="pageNum++">›</a>
				<a v-if="pageNum!=pages" @click="pageNum=pages">»</a>
			</li>
		</ul>

	</div>

	<script src="/scriptZIP/qs.min.js"></script>
	<script src="/scriptZIP/vue.min.js"></script>
	<script src="/scriptZIP/axios.min.js"></script>
	<script src="/js/common.js"></script>
	<script src="/js/list.js"></script>
	<script src="/js/auth_util.js"></script>

	<script>
		var app = new Vue(merge({
			data: {
				urls: {
					del: '/pc/slide/del',
					list: '/pc/slide/list/' + top_params().id
				}
			},
			created: function () {
				this.getData();
				abled('slide', this);
			},
			computed: {
				theme() {
					return localStorage['theme']
				}
			}
		}));
	</script>

</body>

</html>